

from graph import graph

graph.get_graph().print_ascii()

config = {"configurable": {"thread_id": "1"}}

def do_stream(user_input):
    for event in graph.stream(
        {"messages": [("user", user_input)]}, config, stream_mode="values"
    ):
        event["messages"][-1].pretty_print()

# user_input = "Hi there! My name is Will."
# do_stream(user_input)

# user_input = "Remember my name?"
# do_stream(user_input)

# user_input = "what's my name?"
# do_stream(user_input)

while True:
    user_input = input("User: ")
    if user_input.lower() in ["quit", "exit", "q"]:
        print("Goodbye!")
        break

    do_stream(user_input)
